<template>
  <div class="page-header-index-wide page-header-wrapper-grid-content-main">

    <a-row :gutter="24">
      <a-col :md="24" :lg="24">
        <a-card
          style="width:100%"
          :bordered="false"
          :tabList="tabListNoTitle"
          :activeTabKey="noTitleKey"
          @tabChange="key => handleTabChange(key, 'noTitleKey')"
        >
        </a-card>
      </a-col>
    </a-row>
    <!-- <erp-employee-file-form ref="fileForm" :disabled="true" normal></erp-employee-file-form> -->
  </div>
</template>

<script>

  import { getAction } from '@/api/manage'
  // import ErpEmployeeFileForm from '@/views/erp/files/employee/modules/ErpEmployeeFileForm';

  export default {
    components: {
      // ErpEmployeeFileForm
    },
    data() {
      return {
        tabListNoTitle: [{
            key: 'apply',
            tab: '应聘登记表',
          }, {
            key: 'app2',
            tab: '面试信息',
          }, {
            key: 'project1',
            tab: 'HR评价信息',
          },
          {
            key: 'article1',
            tab: '入职申请单',
          }, {
            key: 'file',
            tab: '员工档案管理',
          }, {
            key: 'project2',
            tab: '合同信息',
          },
          {
            key: 'article',
            tab: '转正信息',
          }, {
            key: 'app1',
            tab: '调岗调薪信息',
          }, {
            key: 'project3',
            tab: '离职信息',
          }, {
            key: 'project4',
            tab: '薪酬信息',
          }
        ],
        noTitleKey: 'file',
        url: {
          queryById: '/api/erp/files/employee/erpEmployeeFile/queryById',
        },
        model: {},
      }
    },
    mounted () {
    },
    watch: {
      $route:{
        handler(val,oldval){
          console.log(val);
          console.log(oldval);
          //this.loadData();
        },
        deep: true
      }
    },
    methods: {
      loadData() {
        const id = this.$route.params.id;
        console.log(id);
        getAction(this.url.queryById, { id }).then((res) => {
          if (res.success) {
            const model = res.result
            this.$refs.fileForm.edit(model);
          }
        })
      },
      handleTabChange (key, type) {
        this[type] = key
        this.loadData();
      },
      handleTagClose (removeTag) {
        const tags = this.tags.filter(tag => tag != removeTag)
        this.tags = tags
      },
     
    },
  }
</script>

<style lang="less" scoped>
  .page-header-wrapper-grid-content-main {
    width: 100%;
    height: 100%;
    min-height: 100%;
    transition: .3s;

    .account-center-avatarHolder {
      text-align: center;
      margin-bottom: 24px;

      & > .avatar {
        margin: 0 auto;
        width: 104px;
        height: 104px;
        margin-bottom: 20px;
        border-radius: 50%;
        overflow: hidden;
        img {
          height: 100%;
          width: 100%;
        }
      }

      .username {
        color: rgba(0, 0, 0, 0.85);
        font-size: 20px;
        line-height: 28px;
        font-weight: 500;
        margin-bottom: 4px;
      }
    }

    .account-center-detail {

      p {
        margin-bottom: 8px;
        padding-left: 26px;
        position: relative;
      }

      i {
        position: absolute;
        height: 14px;
        width: 14px;
        left: 0;
        top: 4px;
        background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg)
      }

      .title {
        background-position: 0 0;
      }
      .group {
        background-position: 0 -22px;
      }
      .address {
        background-position: 0 -44px;
      }
    }

    .account-center-tags {
      .ant-tag {
        margin-bottom: 8px;
      }
    }

    .account-center-team {

      .members {
        a {
          display: block;
          margin: 12px 0;
          line-height: 24px;
          height: 24px;
          .member {
            font-size: 14px;
            color: rgba(0, 0, 0, .65);
            line-height: 24px;
            max-width: 100px;
            vertical-align: top;
            margin-left: 12px;
            transition: all 0.3s;
            display: inline-block;
          }
          &:hover {
            span {
              color: #1890ff;
            }
          }
        }
      }
    }

    .tagsTitle, .teamTitle {
      font-weight: 500;
      color: rgba(0,0,0,.85);
      margin-bottom: 12px;
    }

  }

</style>